OpenBuildings GenerativeComponents Help

Interfaces

In OpenBuildingsā„¢ GenerativeComponents, many techniques require a specific property from a node as an input parameter. Just like the different data types, there are different interfaces that associate sets of nodes which are not related in a strict hierarchy but have common properties or behaviors. In OpenBuildingsā„¢ GenerativeComponents and most other object-oriented programming languages, this concept is known as an "Interface". Interfaces are important because they refer to families of objects but are themselves not nodes. An interface is similar to a "promise" of a node to provide certain information (in terms of querying certain named properties of a defined type) or to exhibit certain behaviors.

Typically, data and node types are arranged in a strict hierarchy, while interfaces can cross this hierarchy and express important shared geometric properties and behavior.

For example, every point that implements the IPoint interface must report its X, Y, Z coordinate values. Therefore, in the diagram below we can see that a Point node implements the IPoint interface, as does a plane and a coordinate system.

Another example is that both the Plane type and the Line type implement the IDirection interface, even though these types are only peripherally related in the node type hierarchy. This means that when a "Direction" is required (in a geometric operation such as projection, etc.) it is equally valid to provide a line or a plane.

In the diagram below, if a node implements an interface (or lies within the dotted lines of a particular interface) it can be used as such. For instance, a technique asking for an IDirection can accept a plane, direction, or line because these nodes implement the IDirection interface.